<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"><button @click="add">+1</button>{{count}}</div>
    <script src="../lib/vue.global.js"></script>
    <script>
      const app = Vue.createApp({
        data() {
          return {
            count: 0,
          };
        },
        methods: {
          add() {
            this.count++;
            if (this.count === 5) {
              app.unmount();
            }
          },
        },

        beforeCreate() {
          console.log("beforcreate");
        },
        created() {
          console.log("created");
        },
        beforeMount() {
          console.log("beforeMount");
        },
        mounted() {
          console.log("mounted");
        },
        beforeUpudate() {
          console.log("beforeUpudate");
        },
        updated() {
          console.log("unpudated");
        },
        beforeUnmount() {
          console.log("beforeUnmount");
        },
        unmounted() {
          console.log("unmounted");
        },
      });
      app.mount("#app");
    </script>
  </body>
</html>
